package com.bilibili.juc.me;

import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MyTest {
    static final int HASH_BITS = 0x7fffffff;
    public static void main(String[] args) {
        int h = 99999356;
        int spread = spread(h);
        System.out.println(spread);
        // 0101 1111 0101 1101 1110 0111 1100
        int b1 = 0B101111101011101111001111100;
        int b11 = 0B101111101011101111001111100 >> 16;
        int rs = b1 ^ b11;
        System.out.println(rs);
        int b2 = 0101; // 8^2+8^0=65
        int b3 = 0x101;// 16^2+16^0
        System.out.println(b2);
        System.out.println(b3); //257

        String priceStr = "99.85F";
        Double aDouble = Double.valueOf(priceStr);
        System.out.println(aDouble);

        System.out.println("======================================");
        String str = "11,类似，我有一个系统范围的策略文件，其中不包含 exitVM ";
        Pattern pattern = Pattern.compile("(^\\d+),");
        Matcher matcher = pattern.matcher(str);
        if (matcher.find()){
            System.out.println(matcher.group(0)); // 11,
            System.out.println(matcher.group(1)); // 11
        }
/*        while (matcher.find()){
            System.out.println(matcher.group());
        }*/

    }

    static final int spread(int h) {
        return (h ^ (h >>> 16)) & HASH_BITS;
    }
}
